package cc.mrbird.febs.accounting.service.impl;

import cc.mrbird.febs.accounting.entity.StandardMain;
import cc.mrbird.febs.accounting.entity.StandardSub;
import cc.mrbird.febs.common.entity.QueryRequest;
import cc.mrbird.febs.accounting.entity.StandardSubExtra;
import cc.mrbird.febs.accounting.mapper.StandardSubExtraMapper;
import cc.mrbird.febs.accounting.service.IStandardSubExtraService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.annotation.Propagation;
import lombok.RequiredArgsConstructor;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * 标准明细科目表 Service实现
 *
 * @author baoyinlei
 * @date 2021-11-29 16:39:25
 */
@Service
@RequiredArgsConstructor
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class StandardSubExtraServiceImpl extends ServiceImpl<StandardSubExtraMapper, StandardSubExtra> implements IStandardSubExtraService {

    private final StandardSubExtraMapper standardSubExtraMapper;

    @Override
    public List<StandardSubExtra> getByType(Integer type) {
        LambdaQueryWrapper<StandardSubExtra> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(StandardSubExtra::getType, type);
        queryWrapper.eq(StandardSubExtra::getIsDeleted, 0);
        return this.baseMapper.selectList(queryWrapper);
    }

}
